home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Toolkit / Songbird 0.1 / Songbird_0_1_0.exe / chrome / content / download.xul < prev    next >
Extensible Markup Language  |  2006-02-07  |  9KB  |  212 lines

  1. <?xml version="1.0"?>
  2. <!--
  3. /*
  4. //
  5. // BEGIN SONGBIRD GPL
  6. // 
  7. // This file is part of the Songbird web player.
  8. //
  9. // Copyright┬⌐ 2006 Pioneers of the Inevitable LLC
  10. // http://songbirdnest.com
  11. // 
  12. // This file may be licensed under the terms of of the
  13. // GNU General Public License Version 2 (the ΓÇ£GPLΓÇ¥).
  14. // 
  15. // Software distributed under the License is distributed 
  16. // on an ΓÇ£AS ISΓÇ¥ basis, WITHOUT WARRANTY OF ANY KIND, either 
  17. // express or implied. See the GPL for the specific language 
  18. // governing rights and limitations.
  19. //
  20. // You should have received a copy of the GPL along with this 
  21. // program. If not, go to http://www.gnu.org/licenses/gpl.html
  22. // or write to the Free Software Foundation, Inc., 
  23. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  24. // 
  25. // END SONGBIRD GPL
  26. //
  27.  */
  28. -->
  29. <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
  30. <?xml-stylesheet href="chrome://rmp_demo/skin" type="text/css"?>
  31. <?xml-stylesheet href="chrome://rmp_demo/content/bindings/bindings.css" type="text/css"?>
  32. <!DOCTYPE window SYSTEM "chrome://rmp_demo/locale/rmp_demo.dtd" >
  33. <window
  34.  xmlns:html="http://www.w3.org/1999/xhtml"
  35.  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  36.  xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  37.  id="download"
  38.  title="&download.window;"
  39.  onkeypress="if ( event.keyCode == 13 ) { if ( doOK() ) onExit(); } else if ( event.keyCode == 27 ) { if ( doCancel() ) onExit(); }"
  40.  onload="doLoad();"
  41.  flex="1"
  42.  hidechrome="true"
  43. >
  44.  
  45. <windowregion/>
  46.  
  47. <stack flex="1">
  48.  
  49.   <vbox class="sb_faceplate" flex="1" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();">
  50.     <hbox class="sb_faceplate">
  51.         <image id="chrome_nw" class="sb_faceplate"/>
  52.         <image id="chrome_n" class="sb_faceplate" flex="1"/>
  53.         <image id="chrome_ne" class="sb_faceplate"/>
  54.     </hbox>
  55.     <hbox class="sb_faceplate" flex="1">
  56.         <image id="chrome_w" class="sb_faceplate"/>
  57.         <spacer onmousedown="onBkgDown( event );" onmouseup="onBkgUp();" flex="1"/>
  58.         <image id="chrome_e" class="sb_faceplate"/>
  59.     </hbox>
  60.     <hbox class="sb_faceplate">
  61.         <image id="chrome_sw" class="sb_faceplate"/>
  62.         <image id="chrome_s" class="sb_faceplate" flex="1"/>
  63.         <image id="chrome_se" class="sb_faceplate"/>
  64.     </hbox>
  65.   </vbox>
  66.   
  67.   <vbox class="sb_faceplate" flex="1">
  68.     <hbox class="sb_faceplate" id="frame_top_resizers">
  69.       <x_resizer id="frame_resize_to" dir="topleft" x_style="cursor: nw-resize;"/>
  70.       <x_resizer id="frame_resize_t" dir="top" x_style="cursor: n-resize;" flex="1"/>
  71.       <x_resizer id="frame_resize_to" dir="topright" x_style="cursor: ne-resize;"/>
  72.     </hbox>
  73.     <hbox class="sb_faceplate" flex="1">
  74.     
  75.     <hbox class="sb_faceplate" id="frame_middle_resizers" flex="1">
  76.       
  77.         <vbox class="sb_faceplate">
  78.           <x_resizer id="frame_resize_mo" dir="topleft" x_style="cursor: nw-resize;"/>
  79.           <x_resizer id="frame_resize_m" dir="left" x_style="cursor: w-resize;" flex="1"/>
  80.           <x_resizer id="frame_resize_mo" dir="bottomleft" x_style="cursor: sw-resize;"/>
  81.         </vbox>
  82.         
  83.         <vbox class="sb_faceplate" id="chrome_bkgd" flex="1">
  84.         
  85.           <hbox id="window_top" class="sb_faceplate" >
  86.             <label id="app_title" value="&download.window;" class="sb_faceplate" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>
  87.             <spacer width="5" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>                    
  88.             <spacer flex="1" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>           
  89.             <spacer width="5" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>
  90.             <button id="sysbtn_close" class="sb_faceplate" oncommand="onExit( );" tooltiptext="&tooltip.exit;"/>
  91.           </hbox>
  92.         
  93.           <vbox flex="1">
  94.             <spacer height="5" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>             
  95.             <label class="dialog_label" value="&download.select;"/>
  96.             <spacer height="3" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>             
  97.             <hbox>
  98.               <textbox class="dialog_textbox" id="download_folder_path" />
  99.               <button id="button_browse" label="&window.browse;" class="dialog_button sb_faceplate" oncommand="doBrowse();"/>
  100.             </hbox>        
  101.             <spacer height="3" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>
  102.             <hbox>
  103.               <checkbox class="dialog_checkbox dialog_label" id="download_check" label="&download.always;" />
  104.             </hbox>              
  105.             
  106.           </vbox>
  107.           
  108.           <spacer height="1" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>           
  109.           
  110.           <hbox>
  111.             <spacer flex="1" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>           
  112.             <button id="button_ok" label="&window.ok;" class="dialog_button sb_faceplate" oncommand="if ( doOK() ) onExit( );"/>
  113.             <spacer width="5" onmousedown="onBkgDown( event );" onmouseup="onBkgUp();"/>
  114.             <button id="button_cancel" label="&window.cancel;" class="dialog_button sb_faceplate" oncommand="if ( doCancel() ) onExit( );"/>
  115.           </hbox>
  116.                 
  117.         </vbox>
  118.       
  119.         <vbox class="sb_faceplate">
  120.           <x_resizer id="frame_resize_mo" dir="topright" x_style="cursor: ne-resize;"/>
  121.           <x_resizer id="frame_resize_m" dir="right" x_style="cursor: e-resize;" flex="1"/>
  122.           <x_resizer id="frame_resize_mo" dir="bottomright" x_style="cursor: se-resize;"/>
  123.         </vbox>
  124.         
  125.       </hbox> <!-- frame_middle_resizers -->
  126.     </hbox>
  127.     <hbox class="sb_faceplate" id="frame_bottom_resizers">
  128.       <x_resizer id="frame_resize_to" dir="bottomleft" x_style="cursor: sw-resize;"/>
  129.       <x_resizer id="frame_resize_t" dir="bottom" x_style="cursor: s-resize;" flex="1"/>
  130.       <x_resizer id="frame_resize_to" dir="bottomright" x_style="cursor: se-resize;"/>
  131.     </hbox>
  132.   </vbox>
  133.  
  134.  
  135.    
  136. </stack>
  137.  
  138. <!-- SCRIPTS -->
  139. <script type="application/x-javascript" src="chrome://rmp_demo/content/rmp_demo.js" />
  140. <script type="application/x-javascript" src="chrome://rmp_demo/content/songbird_interfaces.js" />
  141. <script type="application/x-javascript" src="chrome://rmp_demo/content/sbIDataRemote.js" />
  142.   
  143.   
  144.   <script>
  145.   <![CDATA[
  146.     function doLoad()
  147.     {
  148.       var theTextbox = document.getElementById( "download_folder_path" );
  149.       theTextbox.value = SBDataGetValue( "download.folder" );
  150.       var theCheckbox = document.getElementById( "download_check" );
  151.       theCheckbox.checked = SBDataGetIntValue( "download.always" ) == 1;
  152.       var ok = document.getElementById( "button_ok" );
  153.       ok.focus();
  154.     }
  155.     function doOK()
  156.     {
  157.       var theTextbox = document.getElementById( "download_folder_path" );
  158.       var theFolder = theTextbox.value;
  159.       
  160.       // Make sure the folder is valid?
  161.          var aLocalFile = (Components.classes["@mozilla.org/file/local;1"]).createInstance(Components.interfaces.nsILocalFile);
  162.          try
  163.          {
  164.         aLocalFile.initWithPath( theFolder );
  165.         
  166.         // Thou shalt not.
  167.         if ( aLocalFile.isDirectory() )
  168.         {
  169.           SBDataSetValue( "download.folder", theFolder );
  170.           var theCheckbox = document.getElementById( "download_check" );
  171.           SBDataSetValue( "download.always", theCheckbox.checked );
  172.           if ( window.arguments && window.arguments[0] )
  173.           {
  174.             window.arguments[0].value = theTextbox.value;
  175.             window.arguments[0].retval = "ok";
  176.           }
  177.           return true;
  178.         }
  179.       }
  180.       catch ( err )
  181.       {
  182.       }
  183.       return false;
  184.     }
  185.     function doCancel()
  186.     {
  187.       if ( window.arguments && window.arguments[0] )
  188.       {
  189.         var theTextbox = document.getElementById( "download_folder_path" );
  190.         window.arguments[0].value = theTextbox.value;
  191.         window.arguments[0].retval = "cancel";
  192.       }
  193.       return true;
  194.     }
  195.     function doBrowse()
  196.     {
  197.       const CONTRACTID_FILE_PICKER = "@mozilla.org/filepicker;1";
  198.       var nsIFilePicker = Components.interfaces.nsIFilePicker;
  199.       var fp = Components.classes[CONTRACTID_FILE_PICKER].createInstance(nsIFilePicker);
  200.       fp.init( window, "", nsIFilePicker.modeGetFolder);
  201.       var res = fp.show();
  202.       if ( res == nsIFilePicker.returnOK )
  203.       {
  204.         var theTextbox = document.getElementById( "download_folder_path" );
  205.         theTextbox.value = fp.file.path;
  206.       }
  207.     }
  208.   ]]>
  209.   </script>
  210.   
  211.   
  212. </window>